import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 74646
 * Date: 2022-03-07
 * Time: 12:39
 */
public class TestDemo {
    public static void main1(String[] args) {
        PriorityQueue<Integer> priorityQueue = new PriorityQueue<>();//创建一个优先级队列(默认是小根堆)
        priorityQueue.offer(13);
        priorityQueue.offer(3);
        priorityQueue.offer(20);
        System.out.println(priorityQueue); //打印优先级队列
        System.out.println(priorityQueue.poll()); //弹出队头元素
        System.out.println(priorityQueue.peek()); //获取队头元素
    }

    public static void main(String[] args) {
        TreeHeap treeHeap = new TreeHeap();
        int[] array = { 70,56,30,25,15,10 };
//        treeHeap.lastStoneWeight(array);
//        System.out.println();
        //System.out.println(treeHeap.lastStoneWeight(array));
        treeHeap.createTreeHeap(array);
        treeHeap.heapSort();
        System.out.println();
//        treeHeap.offer(80);
//        System.out.println(treeHeap.peek());
//        System.out.println(treeHeap.poll());
//        System.out.println(treeHeap.peek());
//
//        System.out.println(treeHeap.poll());
    }
}
